"
Description
--------------------

I am a specialization of the MenuItemMorph for the Menubar. I adapt the look of the Morph to fit the design of the menubar.
"
Class {
	#name : 'MenubarItemMorph',
	#superclass : 'DockingBarMenuItemMorph',
	#category : 'Morphic-Widgets-Menubar-View',
	#package : 'Morphic-Widgets-Menubar',
	#tag : 'View'
}

{ #category : 'drawing' }
MenubarItemMorph >> drawIconOn: aCanvas [
	| toggledIconFormSet x y |
	self hasIcon ifFalse: [ ^ self ].

	toggledIconFormSet := self toggledIconFormSet.
	x := (self menuStringBounds left - toggledIconFormSet width - 5 ).
	y := (self top + ((self height - toggledIconFormSet height) // 2)).

	aCanvas translucentFormSet: toggledIconFormSet at: x @ y
]

{ #category : 'drawing' }
MenubarItemMorph >> drawSubmenuMarkerOn: aCanvas [

	"Nothing"
]

{ #category : 'drawing' }
MenubarItemMorph >> menuStringBounds [
	| oldBounds |
	oldBounds := super menuStringBounds.
	^ oldBounds left: (oldBounds left + oldBounds right - self measureContents x) // 2
]

{ #category : 'private' }
MenubarItemMorph >> selectionFillStyle [
	^ self theme menubarItemSelectionFillStyleFor: self
]

{ #category : 'private' }
MenubarItemMorph >> selectionTextColor [
	^ self theme menubarItemSelectionTextColorFor: self
]
